module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;
  const UsersSchema = new Schema({
    userName: { type: String, required: true },
    email: { type: String, required: true },
    qq: { type: String, required: true },
    password: { type: String, required: true },
    role: { type: Number, default: 1 },
    // 验证码
    reg: { type: String },
    // 创建日期
    createTime: {
      type: Date,
      default: Date.now()
    },
    // 跟新时间
    updateTime: {
      type: Date,
      default: Date.now()
    }

  });
  return mongoose.model('Users', UsersSchema, 'users');  //返回model
}